<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="root">
    <h2>欢迎来到{{name}}界面</h2>
    <button v-on:click="showInfo" >点我提示信息(不传参)</button>
    <button @click="showInfo2(66,$event)" >点我提示信息（传参）</button>
</div>
<script src="../js/vue.js"></script>
<script>
        Vue.config.productionTip=false//阻止vue启动时产生提示
        new Vue({
             el: "#root",
             data:{
                  name:'cljh',

                },
             methods:{
                 showInfo(event){
                     console.log(event.target.innerText)
                     alert('同学你好1')
                 },
                 showInfo2(number,a){
                     console.log(number,a),
                     /*console.log(event.target.innerText)*/
                     alert('同学你好2')
                 }
            }
         })
</script>
</body>
</html>